fixed output() bug