Null Pointer bug needs fixing