added additional initial error handling