resolving register success message close problem