Fixed callback issue and switched to making AJAX call on every popstate event