modified pointOnPolyCmd, now returns as it should