CHANGE: put ifs on code whom generates errors