fixed a bug with derefcreate