fix messages and added threading