made popup disapear correctly