Change logic slightly