added pagination and fix generating bill