Fixed nil bug