changed to else if