fixed sql error

fixed error where if user clicked on notifications and wasn't in a
network, it would be a sql query to a table that did not exist.