fixed errors and removed json dependency