fix #14, error handling work correctly for remove