Get rit of ref assignment error