extra credit stuff: Get id for handle also some better error handling