fixed most bugs with opening and closing plans
editing modal window