fixing dynamic javascript routes