updated template firstlast in pagination