update: error and success functionalities added