fix bugs in caffes module
known issue: delete function breaks module
add function 'new' in caffes module