added reszie method, and clear cookies