fixing misuse of delete and eval