bug (crashes) fixes