fix saving object which has function as it's properties