handle boundary case