fixes for crash