implemented auto resize when window size changes :)