removing trailing ?> from function scripts