fixed some code which was killed by accident