code was in the wrong place