solved bug in amatch