Fixed NoneType error and worked on CLI