added dependicey and added handleClick method