replaced with working version