Changed cursor from being cast to int, since php casts it to float instead and pagination gets messed up