comment handig
added error handling