actor factory works, but wierd memory error happens sometimes