solve bug in next/previous buttons

Signed-off-by: Karel Kellner <karel@kellner.be>