modified action.c