adding alerts functionality