few error debugs and typos mistakes