fixed error and code cleanup