free json in case of error