replaces some test errors with new function