perform typecheck before object creation to prevent memory leak on error
handlers for creating/loading tilesets