correcting behaviour of popup for editign