Added eventmachine functionality