last updated time stamp and error handling added