fixes wrong usage of 'unless' for nil check