Update test for error messages
Update test to check for success message
Clean up code for displaying messages