fixed a long standing bug