finally fixed so that it owrks with minim