corrected a bug. More to debug