fix bug
add safe checker