added multiple listener support.
compilation fixes