fixes serialize problems with define and attributes working at the same time