Removed useless things and fixed magnet crash