Fixing race condition with assets