removed redundant code for check logged in functionatlity