better conditional checking