fix javascript to correctly display suggestions