Added condition to check whether username session variable is set or not