added metatable functions