afterLayout event listener is commented out