fixed prototype code