handling some boundary cases