Fixed typo in $db access