added overlap check and updated test

added overlap check and updated test