boundary validity checking in