Removed unused imports
Fixed potential crash