fix bug in straight logic