Man survives after bear attacks inside home