add enforceModality parameter. fixes #31