Creating a controller for alerts