++count query; fixed nullable foreign key