fix bug with toggling the status of page