More efficient version of the previous fix

Change-Id: Ib7b12040fb07fe0b25ed164428511abd1baa33de