fixing if/else condition that was breaking the workings