added proper prototype traversal