fixed issue #326 regarding to codes