Fixed so it resolves only once