Fix bug current page not found as not passed to function