Fix reference to files
Add onPage support and fix