most likely the line below should just be in this if statement as well