made  static, moved exit 0 to end