fix bug in resources serialize