setup prototype chain correctly