$entryname is used before it's declared

Signed-off-by: John Rayes <live627@gmail.com>