added or statment to prevent error when posts table is empty