moved code to OnClickListener