[TIMOB-15777] (3_1_X) Bug Fix

Cherry Pick PR #5005 into 3_1_X

Fixes [TIMOB-15777](https://jira.appcelerator.org/browse/TIMOB-15777)