a better way to checking current page