Attempting to return counter from database