performance fix for release mode