Fixing issue where next/prev click would not work