add listener to handle resolution changes, see #4