added null restrictions where needed