(head!=null)-check fixed