Removing echo statement causing problem