changed a few things in the attach function and my kernel doesn't panic anymore!