fix null pointer exception
append api