fixing logic which threw console error during ag1 test