minor
added some safety precautions