refactoring
changed form resize event to media query listener