added error message
added functionality to pop in error message