fixes and remove debug lines