fixed errors in previous patch