fixed bug in resolve()