updated to work with latest PaperPHP