Fixed instances logic in the backend