Fixed segment fault when having a controller connected