add  event and resize