added some safety to format strings
added some safety to format strings