working version for beta