latest working version with portal