finally fixed and working