added page cap and log fix