clean up js syntax so it will run