Updated stored procedure to not insert instance if it already exists