Modification for nextPage return NULL

check out issues #15 and my suggested fix in #18