Updated based on https://github.com/blackberry/BB10-WebWorks-Samples/issues/212#issuecomment-34217828