adding event behaviour