Fix bug with alerts