Fixed closing of modal for non-homepage

https://appirio.my.salesforce.com/a3v50000000IKFy