add try catch around geometry calculations

fix replace start|end to replace instead of adding.