added paginator and safe html handling for pages