changed inspired by; removed extra click handler