fix #3639

based on https://github.com/edx/edx-platform/issues/3639