print success and error messages in separate functions