Implemented suggestion from ColinHebert