fixed None checking