fixing bugs in page button