re-did changes for AUTO-824 bug

this pull request is to re-do a few changes for AUTO-824 bug