Fix click events and resize problems