adding onclick listener
finished incapsulatins