test and fixed create_refobject