added wndProc method