implementing get with error handling