generic modal close/open functions. fixes #101