Created better error handling in scheme