fixed null exception bug