some fixes thansk to @ernesto_jimenez