add logging to find random bug