Creating an alert message when there is something wrong with an ajax call