fixed for null checking