Add paging, send mail, fix some bugs