working version without controller update