Adding code to prevent twice incoming or outcoming in the same time