fix some problem for detecting the markers