fixed bugs in explore function