adding else to gas

replace if with else