fixing paginate and make height automatic