$entryname is used before it's declared