I have very similar code in a my project, seems like a missing feature of ES.