Welcome to the forums.

I have edited your first post and added [code]your code goes here[/code] tags. As I'm sure you can see, this makes reading posted code a lot easier.

Please define "crashes". What does that mean here? What error do you get, and what code is causing it?