chech whether reach to the last page, change variable name