correct foundation close modal implementation