extracted error handling
jquery alert auto hide