Adding sorting and limit feature to grid.
Fixed a big when page entered is not integer.