Added touch support and fixed an error