Fix repository promise resolving