fix will_paginate bug when collection is nil