Bug fix for fatal error