Added in simple error handling