updated with success and error messages