Removed clearState null value and if statement