two functions called the same thing causes problem