fixes a bug causings activities to be processed more than once