added login checks to prevent posting when logged out