Fixed bug with magnets