modified database and onclick listener for listview