Added check for valid username/task