Updated scripthandler, fixes bug in ordering