fixed bug in setCurrentPage() and offset