enabled logging, removed useless code