allow instantiation of objects inside javascript