fix bug for null commandcontext cases
undo changes for dbcontext