fixed routing NOT error, refactor logs and ws