changes done as per bug report