added nil condition on @snack