Sorted out the script for custom page