added null check for itemstacks