savecollecteddata cannot return a value. use a gloable variable instead.