fix style, added validate, added paginate