Prevent TypeError when having input elements in the slider