fixed shutdown sequence in case of continuous pushing of the data

Change-Id: Iabb4ed437ed721669127e134ac41628a33e1b94e