fix undefined notice, clean up enqueue scripts