Implement checkData, added try/catch to functions