fixed next/prev stuff and resetting of buttons