add click functionality and various fixes