Adding logic for current page