adding error handle when streamtype is null