adding null validation