fixed #19 improve signalling mechanism