modified to handle partial content