attempted fixing if statement issue