Fixing php fatal error