fixing bug accessing non-existent element var