add safe guard