Refactored NullPointerException
Added TAG constant for logcat