# Collapsing corvid code doesn't run with latest Google chrome. Help needed

**URL:** <https://forum.wixstudio.com/t/collapsing-corvid-code-doesnt-run-with-latest-google-chrome-help-needed/10237>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [December 13, 2020, 6:58pm UTC](https://forum.wixstudio.com/t/collapsing-corvid-code-doesnt-run-with-latest-google-chrome-help-needed/10237 "2020-12-13T18:58:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ocphotog](https://avatars.discourse-cdn.com/v4/letter/o/48db29/32.png) [@ocphotog](https://forum.wixstudio.com/u/ocphotog)\
**Post date:** [December 13, 2020, 6:58pm UTC](https://forum.wixstudio.com/t/collapsing-corvid-code-doesnt-run-with-latest-google-chrome-help-needed/10237/1 "2020-12-13T18:58:34Z")

</div>

Hi, I have a piece of code that check my database to see if a record was created. If a record was created it collapses a button and some text boxes. If no record found it opens a new member page. It worked fine on older versions of chrome and IE but crashes on the newest versions of Chrome and IE. Not sure why but I hope someone might be able to provide me with some alternative code to fix it.  
Thanks, Mark

The code:

import wixData **from** ‘wix-data’ ;  
import wixWindow **from** ‘wix-window’ ;

// Checks to see if user has a record in ppocc\_members. If not send them to the Member Profile Creation Page - added 10\_28\_2020 from Conditional - looking up database “owner” field 3\_4\_2018

import wixUsers from ‘wix-users’;  
//export function button1\_onclick() {

wixData.query(“ppocc\_members”)

```
     .eq("_owner", wixUsers.currentUser.id) 

     .find() 

     .then( (results) => { 

    if (results.items.length === 0) 

    { 

```

wixLocation.to(`/member-profile-creation`);

```
        } 

    else 

    { 

```

wixLocation.to(`/member-referral-page${wixUsers.currentUser.id}`);  
$w(“#firstprofile”).collapse();  
$w(“#vectorImage3”).collapse();  
$w(“#text67”).collapse();  
$w(“#text123”).collapse();

```
    } 

}); 

```

//}

// end Checks to see if user has a record in ppocc\_members. If not send them to the Member Profile Creation Page - added 10\_28\_2020
