added message detection, fixed build script