Fixed isPage() function and added hasSlug() function