fixed errors in var delcaration and debug string