Fixed registration code to handle existing sns endpoints.