Fixed database error and link to pages