added some safety to format strings