Added functionality to errors function to be limited by field