Can't close Modal windows properly