provide me the crash log then?
it might also help you a lot if you look what the code that you are calling actually does.