added die flag file handling in server.lua