corrected some echo's and a sql error