adding error and success message support