Tried another way to avoid fatal error