fixed some null problems