Fixed bug in pagebar handling