This should be checked for a return value - if true then it should execute what is being executed 'if (homename != NULL)' below.