Added ability to show error and success messages