Fixed a bug in the delete staticitem function