resize window functions properly