change if for unless to fix avatar nil class