add comments and fix mistake in action name in if-block