fix for js paging bug, AEROGEAR-893

see gist

https://gist.github.com/4683988