fixed issue with null pointer when automatic send is enabled