working version for test with online preview