Fixed js reference error

In case that the slider is removed, e.g. because of an ajax navigation
don't throw an error