fixed couple issues, put in debug lines