fix to status write in catch block