php to node, fixed & bug