Change logic to not check twice.