Adding pagination && fixing bugs