fixing fatal error