Fixed delex function