fixed bugs with alerts