removed memory leak
error treatment
error processing