fixed conditional quite strangely