PHP Fatal error:  Call to a member function flush() on a non-object