fixed null reference exception bug
tiny refactoring