fixes js to run only when in dashboard page