first if else worked