Adding proper alerts for errors