added dynamic route and debug option