is appId an array? if so, use appId.empty? (yes the ? is part of the method name) instead of appId.size == 0