fixed non-null db constraint error