Moved error message creation from GUI to controller