the code is fixed for the new magic module