Fixed bug in doing discovering.
(Still have problems in doing mapping)